package com.gtw.memento;

/**
 * 发起人,负责定义哪些属于备份范围,负责创建和恢复备忘录数据
 */
public class Originator {
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    //创建备忘录
    public Mementor createMementor(){
        return new Mementor(this.getState());
    }

    //恢复备忘录
    public void restoreMementor(Mementor mementor){
        this.setState(mementor.getState());
    }
}
